import React, { Component } from 'react'
import Recommend from './index/Recommend'
import Monthlyflowers from './index/Monthlyflowers'
import GiftBouquet from './index/GiftBouquet'
import Succulent from './index/Succulent'
import Fplus from './index/Fplus'
import Freshflower from './index/Freshflower'
import { BrowserRouter as Router, Route } from 'react-router-dom'
import HeaderBar from './index/HeaderBar'
import connect from '../../store/connect'

class Index extends Component {
    render() {
        return (
            <>
            <Router>
                <HeaderBar topCategory={this.props.data.TOP_CATEGORY}></HeaderBar>
                    <div className="indexpage" style={{marginTop:"0.8rem"}}>
                        <Route path="/home/index/recommend" component={Recommend}></Route>
                        <Route path="/home/index/monthlyflowers" component={Monthlyflowers}></Route>
                        <Route path="/home/index/giftbouquet" component={GiftBouquet}></Route>
                        <Route path="/home/index/succulent" component={Succulent}></Route>
                        <Route path="/home/index/fplus" component={Fplus}></Route>
                        <Route path="/home/index/freshflowers" component={Freshflower}></Route>
                    </div>
            </Router>
            </>
        )
    }
    componentDidMount(){
        this.props.loaddata()
    }
}
export default connect(Index)